<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户注册</title>
    <style>
        body { font-family: Arial, sans-serif; max-width: 500px; margin: 0 auto; padding: 20px; }
        .form-group { margin-bottom: 15px; }
        label { display: block; margin-bottom: 5px; font-weight: bold; }
        input { width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; }
        button { background-color: #4CAF50; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; }
        button:hover { background-color: #45a049; }
    </style>
</head>
<body>
<h1>用户注册</h1>
<!-- 表单action使用上下文路径，确保提交到正确的Servlet -->
<form action="${pageContext.request.contextPath}/register" method="post">
    <div class="form-group">
        <label for="username">用户名：</label>
        <input type="text" id="username" name="username" required>
    </div>
    <div class="form-group">
        <label for="password">密码：</label>
        <input type="password" id="password" name="password" required>
        <small>密码长度不能少于6个字符</small>
    </div>
    <div class="form-group">
        <label for="email">邮箱：</label>
        <input type="email" id="email" name="email" required>
    </div>
    <button type="submit">注册</button>
</form>
<p>已有账号？<a href="${pageContext.request.contextPath}/user-register/login.jsp">去登录</a></p>
</body>
</html>